package com.echovin.esb.gateway.oauth2.dao.impl;

import com.echovin.esb.gateway.oauth2.model.PermissionAndRole;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class PermissionAndRoleRowMapper implements RowMapper<PermissionAndRole> {
    public PermissionAndRoleRowMapper() {
    }

    @Override
    public PermissionAndRole mapRow(ResultSet rs, int rowNum) throws SQLException {
        PermissionAndRole pr = new PermissionAndRole();
        pr.setURL(rs.getString("uri"));
        pr.setRoleId(rs.getString("role_id"));
        return pr;
    }
}
